package com.itheima.dao;

import com.itheima.domain.Product;
import com.itheima.util.MyDatabase;

import java.util.List;

public class ProductDao {
    //保存数据的集合【模拟数据库】
    private List<Product> productList = MyDatabase.getData();

    MyDatabase myDatabase = new MyDatabase();

    public List<Product> findAll() {
        return myDatabase.findAll();
    }

    public void add(Product product) {
        myDatabase.add(product);
    }

    public void delete(Integer id) {
        myDatabase.delete(id);
    }
}
